#ifndef SINGLE
//  An adapted ObjectSpace example for use with SGI STL

#include <iostream.h>
#include <algo.h>

#ifdef ACORN_CFRONT
TEMPLATE_ptr_fun_binary(int, int, int)
#endif

#ifdef MAIN
#define ptrbinf2_test main
#endif
static int sum(int x_, int y_)
{
  return x_ + y_;
}
#endif
int ptrbinf2_test(int, char**)
{
  cout<<"Results of ptrbinf2_test:"<<endl;

#ifndef ACORN_CFRONT
int input1 [4] = { 7, 2, 3, 5 };
int input2 [4] = { 1, 5, 5, 8 };
#else
static int input1 [4] = { 7, 2, 3, 5 };
static int input2 [4] = { 1, 5, 5, 8 };
#endif

  int output [4];
  transform(input1, input1 + 4, input2, output, ptr_fun(sum));
  for(int i = 0; i < 4; i++)
    cout << output[i] << endl;
  return 0;
}
